<template>
    <div>
        </br>
        </br>
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
            <el-form-item label="姓名">
                <el-input v-model="formInline.name" placeholder="姓名"></el-input>
            </el-form-item>
            <el-form-item label="邮箱">
                <el-input v-model="formInline.email" :disabled="true"  placeholder="邮箱"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="onSubmit">报名</el-button>
            </el-form-item>
        </el-form>
    </div>
</template>
<script>
import indexApi from '@/api/examination/index.js'
  export default {
    data() {
      return {
        formInline: {
          name: '',
          email: document.cookie.split("vue_admin_template_token=")[1].split(";")[0]
        }
      }
    },
    methods: {
      onSubmit() {
        this.$confirm('确定要进行考试报名, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
            indexApi.saveinfo(this.formInline).then(response => {
            this.$router.push(`/examination1`)
        })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });          
        });
        
      }
    }
  }
</script>